/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controller.Acceso;

import com.visural.common.StringUtil;

/**
 *
 * @author sixviv
 */
public class Facebook {
    // get these from your FB Dev App
    private static final String api_key = "165140523606829";
    private static final String secret = "f72c5ec5dac786723ef85fa9f9de1467";
    private static final String client_id = "165140523606829";

    // set this to your servlet URL for the authentication servlet/filter
    private static final String redirect_uri = "http://localhost:8080/Rite/FBOAuth";
    /// set this to the list of extended permissions you want
    private static final String[] perms = new String[] {"email"};

    public static String getAPIKey() {
        return api_key;
    }

    public static String getSecret() {
        return secret;
    }

    public static String getLoginRedirectURL() {
        return "https://graph.facebook.com/oauth/authorize?client_id=" +
            client_id + "&display=page&redirect_uri=" +
            getRedirect_uri()+"&scope="+StringUtil.delimitObjectsToString(",", perms);
    }

    public static String getAuthURL(String authCode) {
        return "https://graph.facebook.com/oauth/access_token?client_id=" +
            client_id+"&redirect_uri=" +
            getRedirect_uri()+"&client_secret="+secret+"&code="+authCode;
    }

    /**
     * @return the redirect_uri
     */
    public static String getRedirect_uri() {
        return redirect_uri;
    }
}
